/*
 * Copyright (C) 2009 Kristopher T Babic
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, see <http://www.gnu.org/licenses>.
 */

package edu.idp.client.anim;

import java.util.Vector;

/**
 *
 * @author Kristopher T Babic
 */
public class AnimationParameter {

    private Vector params;
    private Vector classes;

    public AnimationParameter() {
        params = new Vector();
        classes = new Vector();
    }

    public void addParameter(Object param, java.lang.Class baseClass) {
        params.addElement(param);
        classes.addElement(baseClass);
    }

    public void removeParameter(Object o) {
        int i = params.indexOf(o);
        if (i == -1)
            return;

        params.removeElement(o);
        classes.removeElement(classes.elementAt(i));
    }

    public void removeAll() {
        params.removeAllElements();
        classes.removeAllElements();
    }

    public java.lang.Class[] getParameterClasses() {
        int size = classes.size();
        if (size == 0)
            return null;

        java.lang.Class[] retClasses = new java.lang.Class[size];
        for (int i = 0; i < size; i++)
            retClasses[i] = (Class) classes.elementAt(i);

        return retClasses;
    }

    public Vector getParameters() {
        return (Vector) params.clone();
        /*     I REMOVED THIS UNTIL I CAN THINK OF A WAY IT WOULD BE USEFUL
         return getParameters((Component)null);
       }
       public Vector getParameters (Component comp) {

         if (comp == null)
           return params;

         Vector retObjs = new Vector();

         retObjs.addElement(comp);
         Enumeration enum = params.elements();
         while(enum.hasMoreElements())
           retObjs.addElement(enum.nextElement());

         return retObjs;
        */
/*
    Object[] objs = params.toArray();
    Object[] retObjs = new Object[params.size()];
    retObjs[0] = comp;

    for (int i = 1; i < params.size() + 1; i++)
      retObjs[i] = objs[i-1];

    return retObjs;
*/
    }
}